package com.bw.controller;

import com.bw.pojo.User;
import com.bw.service.UserService;
import com.bw.utils.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 小怪兽
 * @version 1.0
 * @description: TODO
 * @date 2022/1/6 7:58
 */
@RestController
public class UserController {
    @Autowired
    private UserService service;
    @PostMapping("/list")
    public ResultResponse list(@RequestBody User user){
        return service.list(user);
    }
    @PostMapping("/add")
    public ResultResponse add(@RequestBody User user){
        return service.add(user);
    }
    @PostMapping("/del")
    public ResultResponse del(@RequestBody User user){
        return service.del(user);
    }
    @PostMapping("/update")
    public ResultResponse update(@RequestBody User user){
        return service.update(user);
    }

    @PostMapping("/login")
    public ResultResponse login(@RequestBody User user){
        return service.login(user);
    }

    @PostMapping("/resetPassword")
    public ResultResponse resetPassword(@RequestBody User user){
        return service.resetPassword(user);
    }
}
